/**
 * header头部文件
 * menuList包含title属性代表列表展示名称，props为传给Link标签的属性
 */
'use strict';
import React , { Component } from 'react';
import { Link } from 'react-router';
import { Icon, Badge, Menu, Dropdown } from 'antd';
import {adminUser} from '@app/constants/DataSource.jsx';
import './Header.css';
export default class Header extends Component {
	constructor(props) {
    super(props);
  }
	
  render() {
    const menuList = this.props.menuList;
    const messageList = this.props.messageList;
    const menu = (
      <Menu>
        {menuList.map((item, index) => (
          <Menu.Item key = {index}>
            <a {...item.props}>退出登录</a> 
          </Menu.Item>
        ))}
      </Menu>
    );

    let menuNode, messageNode;

    return (
      <div>
        <img className = 'header-img' src = '../../static/img/logo.png' />
		    <span className = 'alimis-header-title'></span>
        <ul className = "login-message">
          <li className = 'login-menu-list' ref = {(node) => menuNode = node}>
            <Dropdown
              overlay={menu}
              trigger={['click']}
              getPopupContainer = {() => {
                return menuNode;
              }}
            >
          	 <a>{this.props.userName}<Icon style = {{ fontSize: 12 }} type="down" /></a>
            </Dropdown>
          </li>
        </ul>
    	</div>
		);
  }
	
}
